package yunhe.service.impl;


import org.apache.ibatis.session.SqlSession;
import yunhe.dao.AdminDao;
import yunhe.entity.AdminInfo;
import yunhe.service.AdminServers;
import yunhe.util.NewsUtil;
import yunhe.util.SqlSessionFactoryUtil;

public class AdminServersImpl implements AdminServers {

	
	private static SqlSession ss=SqlSessionFactoryUtil.getSqlSession();
	private static AdminDao ad=(AdminDao) ss.getMapper(AdminDao.class);
	
	public AdminInfo login(String naName, String naPass) {		
		String MD5=NewsUtil.str2md5(naName+naPass);
		AdminInfo ai=ad.login(MD5);
		return ai;
	}
	public int register(String naName, String naPass) {
		
		return ad.register(naName, naPass);
	}
	
}
